//package tech.cn.note.word.fun;
//
//import java.util.Optional;
//
//import com.deepoove.poi.render.compute.RenderDataCompute;
//import lombok.extern.slf4j.Slf4j;
//import tech.tongyu.bct.common.enumeration.PriceTypeEnum;
//
//import org.springframework.stereotype.Service;
//
//import static org.springframework.util.ObjectUtils.isEmpty;
//
//@Service
//@Slf4j
//public class PriceTypeFormat implements RenderFunction {
//    @Override
//    public String doCalculate(String[] fields, RenderDataCompute renderDataCompute) {
//        if (isEmpty(fields)) {
//            return "";
//        }
//        String priceTypeName = Optional.ofNullable(renderDataCompute.compute(fields[0])).map(Object::toString).orElse("");
//        String docDesc;
//        try {
//            docDesc = PriceTypeEnum.valueOf(priceTypeName).getDocDesc();
//        } catch (Exception e) {
//            log.error(String.format("价格类型枚举【%s】转换失败：%s", priceTypeName, e));
//            return "";
//        }
//        return docDesc;
//    }
//}
